import request from '@/utils/request'

export function getIncomePayList(params) {
    return request({
        url: '/incomePay',
        method: 'get',
        params,
    })
}
// 获取个人
export function getIncomePay(id) {
    return request({
        url: `/incomePay/${id}`,
        method: 'get',
    })
}

export function delIncomePayById(id) {
    return request({
        url: `/incomePay/${id}`,
        method: 'delete',
    })
}
export function updateIncomePayById(params) {
    return request({
        url: `/incomePay/${params.id}`,
        method: 'put',
        data: params,
    })
}

// 新增收入支出接口
export function addIncomePay(data) {
    const reqbody = {
        timeleave: (new Date()).getTime(),
        income: 0,
        payment: 0,
        info: null
    }
    return request({
        url: '/incomePay',
        method: 'POST',
        data: { ...reqbody, ...data }
    })
}
